package com.efruit.poadapters;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.efruit.authority.AuthorityFactory;
import com.efruit.authority.IUserInfoFetcher;

public class UserInfoFactory extends AuthorityFactory {

	private UserInfoFetcherImpl userInfoFetcherImpl;

	@Override
	public IUserInfoFetcher getUserInfoFetcher() {
		System.out.println("get user info fetcher in factory impl");
		if (userInfoFetcherImpl == null) {
			ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
			userInfoFetcherImpl = (UserInfoFetcherImpl) ctx.getBean("UserInfoFetcherImpl");
		}
		return userInfoFetcherImpl;
	}
}
